<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Computes hash</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mhash-keygen-s2k.html">mhash_keygen_s2k</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.openssl.html">OpenSSL</a></div>
 <div class="up"><a href="ref.mhash.html">Mhash 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.mhash" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mhash</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">mhash</span> &mdash; <span class="dc-title">Computes hash</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.mhash-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">string</span> <span class="methodname"><strong>mhash</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$hash</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$data</code></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>mhash()</strong></span> applies a hash function specified by
   <em><code class="parameter">hash</code></em> to the <em><code class="parameter">data</code></em>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mhash-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">hash</code></em></dt>

     <dd>

      <p class="para">
       The hash ID. One of the <strong><code>MHASH_hashname</code></strong> constants.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">data</code></em></dt>

     <dd>

      <p class="para">
       The user input, as a string.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">key</code></em></dt>

     <dd>

      <p class="para">
       If specified, the function will return the resulting HMAC instead.
       HMAC is keyed hashing for message authentication, or simply a message
       digest that depends on the specified key. Not all algorithms 
       supported in mhash can be used in HMAC mode.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mhash-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the resulting hash (also called digest) or HMAC as a string, or
   <strong><code>FALSE</code></strong> on error.
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.mhash-keygen-s2k.html">mhash_keygen_s2k</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="book.openssl.html">OpenSSL</a></div>
 <div class="up"><a href="ref.mhash.html">Mhash 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
